package com.csw.shuanfa.CodeImprove.redlockThread;

import com.google.common.base.Charsets;
import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

public class BloomFilterGuava {
    public static void main(String[] args) {
        BloomFilter<String> bloomFilter = BloomFilter.create(Funnels.stringFunnel(Charsets.UTF_8), 100000, 0.01);
        bloomFilter.put("aa");
        boolean aa = bloomFilter.mightContain("aa");

    }
}

/**
 * 硬核｜Redis 布隆（Bloom Filter）过滤器原理与实战  https://baijiahao.baidu.com/s?id=1760676476679974031&wfr=spider&for=pc
 */
